<property name="requestContextAttribute" value="request"/>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>登录</title>
    <link rel="stylesheet" href="plugins/layui/css/layui.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="icon" href="images/code.png">
</head>
<body class="login-body" onload="start();">
<script type="text/javascript">
    function start(){
        var firstInput=document.getElementsByTagName("input")[0];
        firstInput.select();
    }
</script>
<div class="login-box">
    <form class="layui-form layui-form-pane" method="post" action="${request.contextPath}/login.do">
        <div class="layui-form-item">
            <h3>IBSM后台登录系统</h3>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">账号：</label>

            <div class="layui-input-inline">
                <input type="text" name="account" class="layui-input" lay-verify="account" placeholder="账号" autocomplete="on" maxlength="20"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码：</label>

            <div class="layui-input-inline">
                <input type="password" name="pwd" class="layui-input" lay-verify="password" placeholder="密码" maxlength="20"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">验证码：</label>

            <div class="layui-input-inline">
                <input type="number" name="code" class="layui-input" lay-verify="code" placeholder="验证码" maxlength="4"/><img src="${request.contextPath}/images/v.png" alt="">
            </div>
        </div>
        <div class="layui-form-item">

            <div class="layui-input-block ">
                <button class="layui-btn btn-submit" lay-submit="" lay-filter="sub">立即登录</button>
            </div>
            <div class="layui-input-block">
                <span style="color:red">${errorMsg!''}</span>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript" src="plugins/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        var $ = layui.jquery,form = layui.form(),layer = layui.layer;
        // 验证
        form.verify({
            account: function (value) {
                if (value == "") {
                    return "请输入用户名";
                }
            },
            password: function (value) {
                if (value == "") {
                    return "请输入密码";
                }
            }
        });
        // 提交监听
        form.on('submit(sub)', function (data) {
            /*layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            });*/
            return true;
        })
    })
</script>
<script language="javascript" type="text/javascript">
    if (window.top != null && window.top.location != window.location) {
        window.top.location = window.location;
    }
</script>
</body>
</html>